import java.util.Scanner;

// HJ62 查找输入整数二进制中1的个数
public class HJ62 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int count = 0;
            if ((n & 1) == 1) {
                count++;
            }
            System.out.println(count);
        }
    }
}
